Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
hypercore-crypto
Advanced tools
The crypto primitives used in hypercore, extracted into a separate module
The crypto primitives used in hypercore, extracted into a separate module
npm install hypercore-crypto
const crypto = require('hypercore-crypto')
const keyPair = crypto.keyPair()
console.log(keyPair) // prints a ed25519 keypair
keyPair = crypto.keyPair()
Returns an ED25519
keypair that can used for tree signing.
signature = crypto.sign(message, secretKey)
Signs a message (buffer).
verified = crypto.verify(message, signature, publicKey)
Verifies a signature for a message.
hash = crypto.data(data)
Hashes a leaf node in a merkle tree.
hash = crypto.parent(left, right)
Hash a parent node in a merkle tree. left
and right
should look like this:
{
index: treeIndex,
hash: hashOfThisNode,
size: byteSizeOfThisTree
}
hash = crypto.tree(peaks)
Hashes the merkle root of the tree. peaks
should be an array of the peaks of the tree and should look like above.
buffer = crypto.randomBytes(size)
Returns a buffer containing random bytes of size size
.
hash = crypto.discoveryKey(publicKey)
Return a hash derived from a publicKey
that can used for discovery
without disclosing the public key.
MIT
FAQs
The crypto primitives used in hypercore, extracted into a separate module
The npm package hypercore-crypto receives a total of 3,097 weekly downloads. As such, hypercore-crypto popularity was classified as popular.
We found that hypercore-crypto demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.